package cn.com.utt.common.proto;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * @author chen.bin
 */

public class ServiceZone {
	/**
	 * 对应charset，ssid 编码方式"0"为 电脑优先 utf-8，"1"为 手机优先 gb2312
	 */
	private int encode;
	/**
	 *  1 为2.4G 2 为5G 
	 */
	private int radio;
	/**
	 * ???
	 */
	private int rfIndex;
	/**
	 * 对应name 服务区名称
	 */
	private String szName;
	/**
	 * 对应sec_type 无线加密方式 “0”:无 “1”:wep “2”:wpa “3”:wpapsk
	 */
	private int authMode;
	/**
	 * 对应name ssid名称
	 */
	private String ssidName;
	/**
	 * 是否自动下发 1为开启 0为关闭
	 */
	private int vlanType;
	/**
	 * 对应hide 是/否隐藏 SSID
	 */
	private int ssidHide;
	/**
	 * 对应client_isolation 无线客户端隔离
	 */
	private int staIsolation;
	/**
	 * 对应vid vlan id
	 */
	private int vlan;

	private RateLimit rateLimit;

	public class RateLimit {
		/**
		 * 对应rxrate
		 */
		private int downRate;
		/**
		 * 对应txrate
		 */
		private int upRate;
		/**
		 * 对应mode
		 */
		private int mode;

		@JSONField(name = "Downrate")
		public int getDownRate() {
			return downRate;
		}

		public void setDownRate(int downRate) {
			this.downRate = downRate;
		}

		@JSONField(name = "Uprate")
		public int getUpRate() {
			return upRate;
		}

		public void setUpRate(int upRate) {
			this.upRate = upRate;
		}

		@JSONField(name = "Mode")
		public int getMode() {
			return mode;
		}

		public void setMode(int mode) {
			this.mode = mode;
		}

	}

	private Wep wep;

	public class Wep {
		public class Knum {
			private String passwd = "";
			private int type;
			private int kfmt;
			private String keySate = "";
			private int authMethod;

			@JSONField(name = "passwd")
			public String getPasswd() {
				return passwd;
			}

			public void setPasswd(String passwd) {
				this.passwd = passwd;
			}

			@JSONField(name = "Type")
			public int getType() {
				return type;
			}

			public void setType(int type) {
				this.type = type;
			}

			@JSONField(name = "kFmt")
			public int getKfmt() {
				return kfmt;
			}

			public void setKfmt(int kfmt) {
				this.kfmt = kfmt;
			}

			@JSONField(name = "key_state_action")
			public String getKeySate() {
				return keySate;
			}

			public void setKeySate(String keySate) {
				this.keySate = keySate;
			}

			@JSONField(name = "BasicAuthenticationMode")
			public int getAuthMethod() {
				return authMethod;
			}

			public void setAuthMethod(int authMethod) {
				this.authMethod = authMethod;
			}

		}

		private Knum knum1;
		private Knum knum2;
		private Knum knum3;
		private Knum knum4;

		@JSONField(name = "kNum1")
		public Knum getKnum1() {
			return knum1;
		}

		public void setKnum1(Knum knum1) {
			this.knum1 = knum1;
		}

		@JSONField(name = "kNum2")
		public Knum getKnum2() {
			return knum2;
		}

		public void setKnum2(Knum knum2) {
			this.knum2 = knum2;
		}

		@JSONField(name = "kNum3")
		public Knum getKnum3() {
			return knum3;
		}

		public void setKnum3(Knum knum3) {
			this.knum3 = knum3;
		}

		@JSONField(name = "kNum4")
		public Knum getKnum4() {
			return knum4;
		}

		public void setKnum4(Knum knum4) {
			this.knum4 = knum4;
		}

	}

	public class Wpa {
		private String radiusIp = "";
		private int radiusPort;
		private int wVersion;
		private int updateTime;
		private int WPAEncryptionModes;
		private String radiusPasswd = "";

		@JSONField(name = "radiusIp")
		public String getRadiusIp() {
			return radiusIp;
		}

		public void setRadiusIp(String radiusIp) {
			this.radiusIp = radiusIp;
		}

		@JSONField(name = "radiusPort")
		public int getRadiusPort() {
			return radiusPort;
		}

		public void setRadiusPort(int radiusPort) {
			this.radiusPort = radiusPort;
		}

		@JSONField(name = "wVersion")
		public int getwVersion() {
			return wVersion;
		}

		public void setwVersion(int wVersion) {
			this.wVersion = wVersion;
		}

		@JSONField(name = "updateTime")
		public int getUpdateTime() {
			return updateTime;
		}

		public void setUpdateTime(int updateTime) {
			this.updateTime = updateTime;
		}

		@JSONField(name = "WPAEncryptionModes")
		public int getWPAEncryptionModes() {
			return WPAEncryptionModes;
		}

		public void setWPAEncryptionModes(int WPAEncryptionModes) {
			this.WPAEncryptionModes = WPAEncryptionModes;
		}

		@JSONField(name = "radiusPasswd")
		public String getRadiusPasswd() {
			return radiusPasswd;
		}

		public void setRadiusPasswd(String radiusPasswd) {
			this.radiusPasswd = radiusPasswd;
		}

	}

	public class Wpapsk {
		private int wVersion;
		private int updateTime;
		private int WPAEncryptionModes;
		private String sharePasswd = "";

		@JSONField(name = "wVersion")
		public int getwVersion() {
			return wVersion;
		}

		public void setwVersion(int wVersion) {
			this.wVersion = wVersion;
		}

		@JSONField(name = "updateTime")
		public int getUpdateTime() {
			return updateTime;
		}

		public void setUpdateTime(int updateTime) {
			this.updateTime = updateTime;
		}

		@JSONField(name = "WPAEncryptionModes")
		public int getWPAEncryptionModes() {
			return WPAEncryptionModes;
		}

		public void setWPAEncryptionModes(int WPAEncryptionModes) {
			this.WPAEncryptionModes = WPAEncryptionModes;
		}

		@JSONField(name = "sharePasswd")
		public String getSharePasswd() {
			return sharePasswd;
		}

		public void setSharePasswd(String sharePasswd) {
			this.sharePasswd = sharePasswd;
		}

	}
	
	private Wpapsk wpaspsk;
	
	private Wpa wpa;

	@JSONField(name = "Encode")
	public int getEncode() {
		return encode;
	}

	public void setEncode(int encode) {
		this.encode = encode;
	}

	@JSONField(name = "Radio")
	public int getRadio() {
		return radio;
	}

	public void setRadio(int radio) {
		this.radio = radio;
	}

	@JSONField(name = "Rfindex")
	public int getRfIndex() {
		return rfIndex;
	}

	public void setRfIndex(int rfIndex) {
		this.rfIndex = rfIndex;
	}

	@JSONField(name = "SzName")
	public String getSzName() {
		return szName;
	}

	public void setSzName(String szName) {
		this.szName = szName;
	}

	@JSONField(name = "BasicAuthenticationMode")
	public int getAuthMode() {
		return authMode;
	}

	public void setAuthMode(int authMode) {
		this.authMode = authMode;
	}

	@JSONField(name = "SsidName")
	public String getSsidName() {
		return ssidName;
	}

	public void setSsidName(String ssidName) {
		this.ssidName = ssidName;
	}

	@JSONField(name = "vlanType")
	public int getVlanType() {
		return vlanType;
	}

	public void setVlanType(int vlanType) {
		this.vlanType = vlanType;
	}

	@JSONField(name = "Ssidhide")
	public String getSsidHide() {
		if (ssidHide == 0) {
			return "No";
		}
		return "Yes";
	}

	public void setSsidHide(int ssidHide) {
		this.ssidHide = ssidHide;
	}

	@JSONField(name = "Staisolation")
	public String getStaIsolation() {
		if (staIsolation == 0) {
			return "No";
		}
		return "Yes";
	}

	public void setStaIsolation(int staIsolation) {
		this.staIsolation = staIsolation;
	}

	@JSONField(name = "Vlan")
	public int getVlan() {
		return vlan;
	}

	public void setVlan(int vlan) {
		this.vlan = vlan;
	}

	@JSONField(name = "Ratelimit")
	public RateLimit getRateLimit() {
		return rateLimit;
	}

	public void setRateLimit(RateLimit rateLimit) {
		this.rateLimit = rateLimit;
	}

	@JSONField(name = "Wep")
	public Wep getWep() {
		return wep;
	}

	public void setWep(Wep wep) {
		this.wep = wep;
	}
	
	@JSONField(name = "Wpapsk")
	public Wpapsk getWpaspsk() {
		return wpaspsk;
	}

	public void setWpaspsk(Wpapsk wpaspsk) {
		this.wpaspsk = wpaspsk;
	}
	
	@JSONField(name = "Wpa")
	public Wpa getWpa() {
		return wpa;
	}

	public void setWpa(Wpa wpa) {
		this.wpa = wpa;
	}

	public static void main(String[] args) {
		ServiceZone sz = new ServiceZone();
		RateLimit rateLimit = sz.new RateLimit();
		sz.setRateLimit(rateLimit);
		System.out.println(JSON.toJSONString(sz));
	}

}
